﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage1.Master" AutoEventWireup="true" CodeBehind="CadEvento.aspx.cs" Inherits="GUI_Web.CadEvento" Theme="Skin1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="telaCadEvento centralizado">
        <table cellspacing="0" cellpadding="5" 
            style="font-size: 12px; border-collapse:collapse;  border-width: thick; width: 50%;">
            <tr>
                <div class="titulo"> Cadastro de Evento </div>
            </tr>
            <tr>
                <td class="tabela_cadastro">
                <div>
                    <table style="width:100%" class="tabela">
                        <tr>
                            <th>Nome</th>
                            <td colspan="2"><asp:TextBox runat="server" ID="txtNome" /></td>
                        </tr>
                        <tr>
                            
                            <th>Pessoa</th>
                            <td colspan="2">
                                <asp:TextBox  ID="txtPe" runat="server" size="50" MaxLength="50" />
                                <asp:Button ID="btnPesqPessoa" runat="server" Text="Buscar" onclick="btnPesqPessoa_Click"  />
                                <div class="tabela_conteudo">
                                <asp:GridView ID="gvPe" runat="server" SkinID="SemPaginacao" ShowHeader="true" 
                                    AutoGenerateColumns="False" >                                                        
                                    <Columns>
                                        <asp:TemplateField ItemStyle-HorizontalAlign="Center">
                                            <HeaderTemplate>
                                                <asp:CheckBox ID="ckbHeader" runat="server" AutoPostBack="True" OnCheckedChanged="ckbHeader_CheckedChanged" />
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="CheckBox1" runat="server" CommandArgument='<%# Eval("IdPessoa")%>'/>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="IdPessoa" HeaderText="Código" />
                                        <asp:BoundField DataField="nome"  HeaderText="Nome" />
                                    </Columns>
                                </asp:GridView>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <th>Equipamento</th>
                            <td colspan="2">
                                <asp:TextBox  ID="txtEquip" runat="server" size="50" MaxLength="50" />
                                <asp:Button ID="btnPesqEquip" runat="server" Text="Buscar" onclick="btnPesqEquip_Click"  />
                                <div class="tabela_conteudo">
                                <asp:GridView ID="gvEquip" runat="server" SkinID="SemPaginacao" ShowHeader="true" 
                                    AutoGenerateColumns="False" >                                                        
                                    <Columns>

                                        <asp:TemplateField ItemStyle-HorizontalAlign="Center">
                                            <HeaderTemplate>
                                                <asp:CheckBox ID="ckbHeader" runat="server" AutoPostBack="True" OnCheckedChanged="ckbHeader_CheckedChanged" />
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="CheckBox1" runat="server" CommandArgument='<%# Eval("IdEquip")%>'/>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="IdEquip" HeaderText="Código" />
                                        <asp:BoundField DataField="nome"  HeaderText="Nome" />
                                    </Columns>
                                </asp:GridView>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <th>Sala</th>
                            <td colspan="2">
                                <asp:TextBox  ID="txtSala" runat="server" size="50" MaxLength="50" />
                                <asp:Button ID="btnPesqSala" runat="server" Text="Buscar" onclick="btnPesqSala_Click"  />
                                <div class="tabela_conteudo">
                                <asp:GridView ID="gvSala" runat="server" SkinID="SemPaginacao" ShowHeader="true" 
                                    AutoGenerateColumns="False" >                                                        
                                    <Columns>

                                        <asp:TemplateField ItemStyle-HorizontalAlign="Center">
                                            <HeaderTemplate>
                                                <asp:CheckBox ID="ckbHeader" runat="server" AutoPostBack="True" OnCheckedChanged="ckbHeader_CheckedChanged" />
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="CheckBox1" runat="server" CommandArgument='<%# Eval("IdSala")%>'/>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="IdEquip" HeaderText="Código" />
                                        <asp:BoundField DataField="nome"  HeaderText="Nome" />
                                    </Columns>
                                </asp:GridView>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <th>Evento semanal</th>
                            <td>
                                <asp:RadioButtonList ID="rblEvenSem" runat="server" 
                                    RepeatDirection="Horizontal" AutoPostBack="True" 
                                    onselectedindexchanged="rblEvenSem_SelectedIndexChanged">
                                    <asp:ListItem Value="1">sim</asp:ListItem>
                                    <asp:ListItem Value="2">não</asp:ListItem>
                                </asp:RadioButtonList>
                            </td>
                        </tr>
                        <tr>
                            <th>Data</th>
                            <td><asp:TextBox ID="txtData" runat="server" />  </td>
                            <td rowspan="3"><asp:Calendar ID="Calendar1" runat="server" OnSelectionChanged="Change" /></td>
                        </tr>
                        <tr runat="server" id="trIni">
                            <td align="right">
                                <asp:RadioButton runat="server" ID="rbtnInicio" Text="Início: " GroupName="lala" />
                            </td>
                            <td>
                                <asp:TextBox runat="server" ID="txtDataIni" />
                            </td>                            
                        </tr>
                        <tr runat="server" id="trFim">
                            <td align="right">
                                <asp:RadioButton runat="server" ID="rbtnFim" Text="Fim: " GroupName="lala" />
                            </td>
                            <td>
                                <asp:TextBox runat="server" ID="txtDataFim" />
                            </td>
                        </tr>
                        <tr>
                            <th>Duração</th>
                            <td><asp:TextBox runat="server" ID="txtQtddHora" SkinID="Hora" /></td>
                        </tr>
                        <tr>
                            <td colspan="2" align="center">
                            <asp:Button runat="server" ID="btnGeraHora" Text="Gerar Horas" 
                            onclick="btnGeraHora_Click" /></td>
                        </tr>
                        <tr id="trHora" runat="server" visible="false">
                            <th>Hora: </th>
                            <td>                                
                                <asp:DropDownList runat="server" ID="ddlHora">
                                    <asp:ListItem Text="14:00 - 17:00" />
                                    <asp:ListItem Text="19:00 - 22:00" />
                                </asp:DropDownList>                      
                            </td>
                        </tr>
                        </table>                        
                    </div>                    
                    </td>
                </tr>
                <tr>
                    <td>
                    <table cellpadding="5" width="50px" style="text-align:center;" >
                        <tr>
                            <td class="style1"><asp:Button ID="btnSalvar" runat="server" Text="Salvar" 
                                    onclick="btnSalvar_Click"/></td>              
                            <td class="style1"><asp:Button ID="btnExcluir" runat="server" Text="Excluir" 
                                    OnClientClick="return confirm('Tem certeza que deseja excluir este evento ?');" 
                                    Enabled="true" onclick="btnExcluir_Click"/></td>
                            <td class="style1"><asp:Button ID="btnVoltar" runat="server" Text="Voltar" 
                                    onclick="btnVoltar_Click"/></td>
                        </tr>
                        <tr><asp:Label runat="server" ID="lblerro" /></tr>
                    </table>  
                </td>  
             </tr>
            </table>
    </div>
</asp:Content>
